#include <stdio.h>
#include <string.h>
/*
//strcat
char *mystrcat(char *dest, const char *strc)
{   
    int len=0,t=0;
    while(dest[len]!='\0')
    {
        len++;
    }
    printf("len=%d\n",len);

    while(1)
    {
        dest[len] = strc[t];
        if(dest[len]==0)
        {
            break;
        }
        len++;
        t++;
    }
    return dest;
    
}

//strcpy
char *mystrcpy(char *dest, const char *strc)
{
    int len=0,t=0;
    while(1)
    {
        dest[len] = strc[t];
        if(dest[len]==0)
        {
            break;
        }
        len++;
        t++;
    }
    return dest;
}
*/
char *mystrcmp(char *dest, const char *strc)
{
    int len=0;
    while(dest[len]==strc[len] && dest[len]!='\0')
    {
        len++;
    }   
    if (dest[len]>strc[len])
    {
        printf("%s > %s \n",dest,strc);
    }
    else if (dest[len]<strc[len])
    {
        printf("%s < %s \n",dest,strc);

    }
    else 
    {
        printf("%s = %s \n",dest,strc);
    }    
}


int main(int argc, char const *argv[])
{
    char a1[100]={0};
    char a2[100]={0};
    
    printf("请输入第一个字符串>:");  
    scanf("%s",a1);
    printf("请输入第二个字符串>:");
    scanf("%s",a2);

    printf("字符串1为:%s \n",a1);
    printf("字符串2为:%s \n",a2);
  
    //mystrcat(a1,a2);  //strcat
    //mystrcpy(a1,a2);  //strcpy
    //printf("字符串1为:%s \n",a1);
    //printf("字符串2为:%s \n",a2);
    //mystrcmp(a1,a2);

  
    return 0;
}




